<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="father">
    <p id="child1">1</p>
    <p>2</p>
    <p id="child3">3</p>
  </div>
</body>
<script>
  const testObj = {
    name: 11,
    user: {
      name: 'zhang'
    }
  }
  const testObj1 = {
    name: 11,
    user: {
      name: 'zhang'
    }
  }

  let p = new Proxy(testObj, {
    get(target, key,receiver) {
      console.log('get',target, key)
      return Reflect.get(target,key,receiver)
    },
    set(target, key, newVal) {
      console.log('set')
      return target[key] = newVal
    }
  })
  // console.log(p.user.name)

  p.user.name = 32
  // console.log(p.user.age)
</script>

</html>